package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.*;

import java.util.List;

public class BankService {
    public Bank createNewBank() {
        return new Bank();
    }

    public Client addClient(Bank bank, Client client) {
        return bank.addClient(client);
    }

    public void printBalance(Bank bank) {
        for (Client c : bank.getClients()) {
            for (Account acc : c.getAccounts()) {
                System.out.println(String.format("Accouns <%s>, balance: %s$", acc.getId(), acc.getBalance()));
            }
        }
    }

    public void printMaximumAmountToWithdraw(Bank bank) {
        for (Client c : bank.getClients()) {
            for (Account acc : c.getAccounts()) {

                System.out.println(String.format("Accouns <%s>, maximum amount to withdraw: %s$",
                        acc.getId(), acc.maximumAmountToWithdraw()));
            }
        }
    }

}
